//index.js
//获取应用实例
var app = getApp()
Page({
  data: {
    motto: '1546879456552',
    shubi: '200',
    userInfo: {},
    grids: [{
      items: 0,
      images: '/images/pay.png',
      text: '充值',
      url:'/pages/pay/pay'
    }, {
      items: 1,
      images: '/images/recent.png',
      text: '阅读历史',
      url: '/pages/pay/pay'
      }, {
        items: 2,
        images: '/images/discovery.png',
        text: '消费记录',
        url: '/pages/pay/pay'
    }, {
      items: 3,
      images: '/images/pay.png',
      text: '送书币',
      url: '/pages/pay/pay'
      }, {
        items: 4,
        images: '/images/star.png',
        text: '书签',
        url: '/pages/pay/pay'
    }, {
      items: 5,
      images: '/images/book.png',
      text: '书库',
      url: '/pages/pay/pay'
    }]
  },
  //事件处理函数
  bindViewTap: function () {
    wx.navigateTo({
      url: '../logs/logs'
    })
  },
  onLoad: function () {
    console.log('onLoad')
    var that = this
    //调用应用实例的方法获取全局数据
    app.getUserInfo(function (userInfo) {
      //更新数据
      that.setData({
        userInfo: userInfo
      })
    })
  }
})
